package org.tnaggs.project.manager;

import java.util.List;

import org.tnaggs.project.model.Player;
import org.tnaggs.project.repository.PlayerRepository;

public class PlayerManager {

	private PlayerRepository playerRepo;
	
	
	public PlayerManager(PlayerRepository playerR) {
		this.setPlayerRepo(playerR);

	}

	public void createPlayer(Player newVal) {
		playerRepo.insert(newVal);
	}



	public PlayerRepository getPlayerRepo() {
		return playerRepo;
	}

	public void setPlayerRepo(PlayerRepository playerRepo) {
		this.playerRepo = playerRepo;
	}

	public List<Player> getPlayers(int teamID) {
		return playerRepo.findAllByTeamID(teamID);
	}
	
	
	
	
}
